/**
 * <copyright>
 * </copyright>
 *
 * 
 */
package de.claaswilke.presents.resource.presents.mopp;

public class PresentsMetaInformation implements de.claaswilke.presents.resource.presents.IPresentsMetaInformation {
	
	public String getSyntaxName() {
		return "presents";
	}
	
	public String getURI() {
		return "http://www.claaswilke.de/presents";
	}
	
	public de.claaswilke.presents.resource.presents.IPresentsTextScanner createLexer() {
		return new de.claaswilke.presents.resource.presents.mopp.PresentsAntlrScanner(new de.claaswilke.presents.resource.presents.mopp.PresentsLexer());
	}
	
	public de.claaswilke.presents.resource.presents.IPresentsTextParser createParser(java.io.InputStream inputStream, String encoding) {
		return new de.claaswilke.presents.resource.presents.mopp.PresentsParser().createInstance(inputStream, encoding);
	}
	
	public de.claaswilke.presents.resource.presents.IPresentsTextPrinter createPrinter(java.io.OutputStream outputStream, de.claaswilke.presents.resource.presents.IPresentsTextResource resource) {
		return new de.claaswilke.presents.resource.presents.mopp.PresentsPrinter2(outputStream, resource);
	}
	
	public org.eclipse.emf.ecore.EClass[] getClassesWithSyntax() {
		return new de.claaswilke.presents.resource.presents.mopp.PresentsSyntaxCoverageInformationProvider().getClassesWithSyntax();
	}
	
	public org.eclipse.emf.ecore.EClass[] getStartSymbols() {
		return new de.claaswilke.presents.resource.presents.mopp.PresentsSyntaxCoverageInformationProvider().getStartSymbols();
	}
	
	public de.claaswilke.presents.resource.presents.IPresentsReferenceResolverSwitch getReferenceResolverSwitch() {
		return new de.claaswilke.presents.resource.presents.mopp.PresentsReferenceResolverSwitch();
	}
	
	public de.claaswilke.presents.resource.presents.IPresentsTokenResolverFactory getTokenResolverFactory() {
		return new de.claaswilke.presents.resource.presents.mopp.PresentsTokenResolverFactory();
	}
	
	public String getPathToCSDefinition() {
		return "de.claaswilke.presents/metamodel/presents.cs";
	}
	
	public String[] getTokenNames() {
		return de.claaswilke.presents.resource.presents.mopp.PresentsParser.tokenNames;
	}
	
	public de.claaswilke.presents.resource.presents.IPresentsTokenStyle getDefaultTokenStyle(String tokenName) {
		return new de.claaswilke.presents.resource.presents.mopp.PresentsTokenStyleInformationProvider().getDefaultTokenStyle(tokenName);
	}
	
	public java.util.Collection<de.claaswilke.presents.resource.presents.IPresentsBracketPair> getBracketPairs() {
		return new de.claaswilke.presents.resource.presents.mopp.PresentsBracketInformationProvider().getBracketPairs();
	}
	
	public org.eclipse.emf.ecore.EClass[] getFoldableClasses() {
		return new de.claaswilke.presents.resource.presents.mopp.PresentsFoldingInformationProvider().getFoldableClasses();
	}
	
	public org.eclipse.emf.ecore.resource.Resource.Factory createResourceFactory() {
		return new de.claaswilke.presents.resource.presents.mopp.PresentsResourceFactory();
	}
	
	public de.claaswilke.presents.resource.presents.mopp.PresentsNewFileContentProvider getNewFileContentProvider() {
		return new de.claaswilke.presents.resource.presents.mopp.PresentsNewFileContentProvider();
	}
	
	public void registerResourceFactory() {
		org.eclipse.emf.ecore.resource.Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(getSyntaxName(), new de.claaswilke.presents.resource.presents.mopp.PresentsResourceFactory());
	}
	
	/**
	 * Returns the key of the option that can be used to register a preprocessor that
	 * is used as a pipe when loading resources. This key is language-specific. To
	 * register one preprocessor for multiple resource types, it must be registered
	 * individually using all keys.
	 */
	public String getInputStreamPreprocessorProviderOptionKey() {
		return getSyntaxName() + "_" + "INPUT_STREAM_PREPROCESSOR_PROVIDER";
	}
	
	/**
	 * Returns the key of the option that can be used to register a post-processors
	 * that are invoked after loading resources. This key is language-specific. To
	 * register one post-processor for multiple resource types, it must be registered
	 * individually using all keys.
	 */
	public String getResourcePostProcessorProviderOptionKey() {
		return getSyntaxName() + "_" + "RESOURCE_POSTPROCESSOR_PROVIDER";
	}
	
	public String getLaunchConfigurationType() {
		return "de.claaswilke.presents.resource.presents.ui.launchConfigurationType";
	}
	
	public de.claaswilke.presents.resource.presents.IPresentsNameProvider createNameProvider() {
		return new de.claaswilke.presents.resource.presents.analysis.PresentsDefaultNameProvider();
	}
	
	public String[] getSyntaxHighlightableTokenNames() {
		de.claaswilke.presents.resource.presents.mopp.PresentsAntlrTokenHelper tokenHelper = new de.claaswilke.presents.resource.presents.mopp.PresentsAntlrTokenHelper();
		java.util.List<String> highlightableTokens = new java.util.ArrayList<String>();
		String[] parserTokenNames = getTokenNames();
		for (int i = 0; i < parserTokenNames.length; i++) {
			// If ANTLR is used we need to normalize the token names
			if (!tokenHelper.canBeUsedForSyntaxHighlighting(i)) {
				continue;
			}
			String tokenName = tokenHelper.getTokenName(parserTokenNames, i);
			if (tokenName == null) {
				continue;
			}
			highlightableTokens.add(tokenName);
		}
		highlightableTokens.add(de.claaswilke.presents.resource.presents.mopp.PresentsTokenStyleInformationProvider.TASK_ITEM_TOKEN_NAME);
		return highlightableTokens.toArray(new String[highlightableTokens.size()]);
	}
	
}
